<?php
$path = dirname(__FILE__);
require_once($path . '/simpletest/autorun.php');
require_once($path . '/index.php');
require_once($path . '/../app/Model/Product.php');

class Test__of__Model_Product extends UnitTestCase {
	
	function __construct() {
		$this->mp = new Model_Product();
    }

	// 測試get_new_invite_list獲取的數組長度是否大於等於7
    function test_Product_get_new_invite_list() {
		$x = $this->mp->get_new_invite_list();
		$y = count($x);
		$this->assertOutsideMargin($y, 0, 6);	// assertOutsideMargin($x, $y, $m)	Fail if abs($x - $y) < $m is true
    }

	// 測試get_submit_report_list獲取的數組長度是否大於等於4
	function test_Product_get_submit_report_list() {
		$x = $this->mp->get_submit_report_list();
		$y = count($x['result']);
		$this->assertOutsideMargin($y, 0, 3);	// assertOutsideMargin($x, $y, $m)	Fail if abs($x - $y) < $m is true
    }
	
	// 測試get_get_new_report_list獲取的數組長度是否大於等於4
	function test_Product_get_new_report_list() {
		$x = $this->mp->get_new_report_list();
		$y = count($x['result']);
		$this->assertOutsideMargin($y, 0, 3);	// assertOutsideMargin($x, $y, $m)	Fail if abs($x - $y) < $m is true
	}

}
?>